package com.nbsaas.boot.merchant.rest.convert;

import com.nbsaas.boot.merchant.data.entity.Merchant;
import com.nbsaas.boot.merchant.api.domain.request.MerchantRequest;

import org.springframework.beans.BeanUtils;
import com.nbsaas.boot.rest.api.Converter;
import com.nbsaas.boot.utils.BeanDataUtils;

/**
* 商家请求对象转换成实体对象
*/

public class MerchantEntityConvert  implements Converter<Merchant, MerchantRequest> {

    @Override
    public Merchant convert(MerchantRequest source) {
        Merchant result = new Merchant();
        BeanDataUtils.copyProperties(source, result);
        return result;
    }
}

